test-local-pull: Sort find output to make test robust
authorAlexander Larsson <alexl@redhat.com>
Mon, 8 Dec 2014 19:26:58 +0000 (20:26 +0100)
committerAlexander Larsson <alexl@redhat.com>
Mon, 8 Dec 2014 19:28:09 +0000 (20:28 +0100)
There is no guarantee that find will produce output in the same
order, so we need to sort the output to ensure we always
get the same output.

https://bugzilla.gnome.org/show_bug.cgi?id=741125

tests/test-local-pull.sh

index 9c97aa12f2f3f7e9220f5056ea083ce5d264ed1b..df5342ded4c006853cdcd816e3bc8ad6c95bbfc8 100755 (executable)
@@ -44,13 +44,13 @@ echo "ok pull-local bare-user to z2"
 # Verify the name + size + mode + type + symlink target + owner/group are the same
 # for all checkouts
 ${CMD_PREFIX} ostree checkout --repo repo test2 checkout1
-find checkout1 -printf '%P %s %#m %u/%g %y %l\n' > checkout1.files
+find checkout1 -printf '%P %s %#m %u/%g %y %l\n' | sort > checkout1.files
 
 ${CMD_PREFIX} ostree checkout --repo repo2 test2 checkout2
-find checkout2 -printf '%P %s %#m %u/%g %y %l\n' > checkout2.files
+find checkout2 -printf '%P %s %#m %u/%g %y %l\n' | sort > checkout2.files
 
 ${CMD_PREFIX} ostree checkout --repo repo3 test2 checkout3
-find checkout3 -printf '%P %s %#m %u/%g %y %l\n' > checkout3.files
+find checkout3 -printf '%P %s %#m %u/%g %y %l\n' | sort > checkout3.files
 
 cmp checkout1.files checkout2.files
 cmp checkout1.files checkout3.files